package com.jinghao.ctws.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jinghao.core.common.controller.JingHaoBaseController;
import com.jinghao.ctws.entity.CwvFlow;
import com.jinghao.ctws.service.ICwvFlowService;

@Controller
@Scope("prototype")
@RequestMapping(value = "/app/ctws/CwvFlow")
public class CwvFlowController extends JingHaoBaseController<CwvFlow> {
	//==================定制内容开始======================
//在这里修改代码
	/**
	 * 所有流程列表
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/listCwvFlow",method = RequestMethod.GET) 
	public Map<String, Object> listCwvFlow(@ModelAttribute("model") CwvFlow model){
		this.getCwvFlowService().listCwvFlow(model);
        return model.getListJson();   
	} 
	/**
	 * 获取单个流程信息（包含环节信息）
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/getSingleCwvFlowInfo",method = RequestMethod.GET) 
	public Map<String, Object> getSingleCwvFlowInfo(@ModelAttribute("model") CwvFlow model){
		this.getCwvFlowService().getSingleCwvFlowInfo(model);
        return model.getSingleJson();   
	} 
	//==================定制内容结束======================

	@Autowired
	public void setCwvFlowService(ICwvFlowService cwvFlowService) {
		super.setIJingHaoBaseService(cwvFlowService);
	}

	public ICwvFlowService getCwvFlowService() {
		return (ICwvFlowService) super.getIJingHaoBaseService();
	}
}
